home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / amos / eaissu3b.lha / Source_Code / VS_Disk_Status.AMOS / VS_Disk_Status.amosSourceCode
AMOS Source Code  |  1995-12-30  |  1KB  |  41 lines

  1. '*                        WProtect.AMOS                      * 
  2. '*                 ï¿½1992 by Volker Stepprath                 * 
  3. '*  Test the diskstaus in any drive also a `Not a DOS Disk`  * 
  4. '**** Turn off request ****
  5. Request Off 
  6. '**** Define variables ****
  7. DISKREP$=Space$(40)+Chr$(0)
  8. DEVNAME$="trackdisk.device"+Chr$(0)
  9. IOREQ$=Space$(80)+Chr$(0)
  10. DISKREP=Varptr(DISKREP$)
  11. DEVNAMEADR=Varptr(DEVNAME$)
  12. IOREQADR=Varptr(IOREQ$)
  13. '**** Set diskdrive **** 
  14. Input "Drivenumber (0,1,2,3):";UNIT
  15. '**** Search for own taskaddress ****
  16. XTASK=Execall(-294)
  17. Loke DISKREP+$10,XTASK
  18. '**** Install register ****
  19. Areg(0)=DEVNAMEADR
  20. Areg(1)=IOREQADR
  21. Dreg(0)=UNIT
  22. Dreg(1)=0
  23. '**** Open device **** 
  24. XOPENDEV=Execall(-444)
  25. '**** Check protectionstatus of disk ****
  26. Loke IOREQADR+14,DISKREP
  27. Doke IOREQADR+28,15
  28. XDOIO=Execall(-456)
  29. PROTECT=Leek(IOREQADR+32)
  30. '**** Turn off motor ****
  31. Doke IOREQADR+28,9
  32. Loke IOREQADR+36,0
  33. XDOIO=Execall(-456)
  34. '**** Show diskstatus **** 
  35. If PROTECT Then N$="YES" Else N$="NO"
  36. Print "Writeprotection activ: ";N$
  37. '**** Close device ****
  38. XCLOSEDEV=Execall(-450)
  39. '**** Turn on request **** 
  40. Request On 
  41. End